function show() {
    let web = "houduanren.com";
}

function init() {
    var name = 'Mozilla';
    function displayName() {
        console.log(name);
    }
    displayName();
}
init();
function makeFunc() {
    let name = "Mozilla--";
    function displayName() {
        console.log(name);
    }
    return displayName;
}
const myFunc = makeFunc();
myFunc();
function makeAdder(x) {
    return function (y) {
        return x + y;
    };
}
const add5 = makeAdder(5);
const add10 = makeAdder(10);
console.log(add5(2));
console.log(add10(2));

function makeSizer(size) {
    return function () {
        document.body.style.fontSize = size + 'px';
    };
}
const size12 = makeSizer(12);
const size14 = makeSizer(14);
const size16 = makeSizer(16);

document.getElementById('size-12').onclick = size12;
document.getElementById('size-14').onclick = size14;
document.getElementById('size-16').onclick = size16;

/** 
 * 下面的代码展示了如何使用闭包来创建一个计数器。每次调用 makeCounter 都会返回一个新的计数器。
 */